package univer.oko.payment.operations;

import univer.oko.gui.*;

import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableColumnModel;
import java.awt.*;
import java.rmi.RemoteException;


public abstract class AbstractPaymentOperations extends CDInternalFrame {
    protected DefaultTableColumnModel columnModel;
    protected DefaultTableCellRenderer cellRenderer;

    protected CDTextField lastName;
    protected CDTextField firstName;
    protected CDComboBox faculty;
    protected CDComboBox direction;
    protected CDComboBox speciality;
    protected CDFormattedTextField dateFrom;
    protected CDFormattedTextField dateTo;

    protected CDButton find;
    protected CDButton print;
    protected CDButton delete;

    protected JPanel searchpane;

    //
    protected AbstractPaymentOperations() {
        super();
    }

    protected abstract void initPanel();

    protected abstract void fillControls() throws RemoteException;

    protected abstract void addActions();

    //
    public void add(Component c, GridBagConstraints constraints, int x, int y, int w, int h) {
        constraints.gridx = x;
        constraints.gridy = y;
        constraints.gridwidth = w;
        constraints.gridheight = h;
        searchpane.add(c, constraints);
    }
}